import { http } from "@/utils/request";
import type {
  pagerListQueryType,
  pagerListQueryTypeResponse,
} from "@/interface/common.ts";
import type {
  globalRole,
  globalRoleVo,
} from "@/interface/pm/globalProjRole.ts";

export const getGlobalProjRoleList = (
  data: pagerListQueryType,
): Promise<pagerListQueryTypeResponse<globalRoleVo>> => {
  return http.post("/globalRole/list", data);
};

export const createGlobalProjRole = (
  data: globalRoleVo,
): Promise<globalRole> => {
  return http.post("/globalRole/create", data);
};

export const updateGlobalProjRole = (data: globalRoleVo): Promise<null> => {
  return http.put("/globalRole/edit", data);
};

export const getGlobalProjRole = (id: string): Promise<globalRoleVo> => {
  return http.get(`/globalRole/${id}`);
};

export const deleteGlobalProjRole = (id: string): Promise<globalRoleVo> => {
  return http.delete(`/globalRole/${id}`);
};
